﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shop.Data;
using System.ComponentModel;

namespace Shop.CartResources
{
    public class Cart
    {
        private BindingList<ICartItem> cartItems = new BindingList<ICartItem>();
        public decimal FullCartPrice { get; set; }

        public BindingList<ICartItem> CartItems
        {
            get
            {
                return cartItems;
            }
            set
            {
                cartItems = value;
            }
        }

        public void AddProduct(ICartItem productToAdd)
        {
            this.cartItems.Add(productToAdd);
            this.FullCartPrice += cartItems[cartItems.Count - 1].Price;
        }
    }
}
